package com.telit.firecommand.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.telit.firecommand.dto.*;
import com.telit.firecommand.vo.FireQueryAllListVO;
import com.telit.firecommand.vo.FireQuerySituationAllListVO;
import com.telit.firecommand.vo.ResourceSimpLevelMinVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Create by Chencf 2022/12/21
 */
public interface FireQueryDao {
    List<Map> queryFireCountVO(@Param("fireCountDTO")FireCountDTO fireCountDTO);

    List<Map> fireCountByDistrictCode(@Param("rank") Integer rank);

    List<Map> fireSimpListByViewSearch(@Param("rank") Integer rank, @Param("ViewSearchDTO") ViewSearchDTO viewSearchDTO);

    List<Map> fireResourceSimpListByViewSearch(@Param("rank") Integer rank, @Param("tableName") String tableName, @Param("ViewSearchDTO") ViewSearchDTO viewSearchDTO);

    List<Map> fireCameraSimpListByViewSearch(@Param("rank") Integer rank, @Param("tableName") String tableName, @Param("ViewSearchDTO") ViewSearchDTO viewSearchDTO,@Param("type") String type);

    List<ResourceSimpLevelMinVO> fireListBySearchLevelMin( @Param("ViewSearchDTO") ViewSearchDTO viewSearchDTO);

    List<ResourceSimpLevelMinVO> fireCameraSimpList(@Param("rank") Integer rank, @Param("ViewSearchDTO") ViewSearchDTO viewSearchDTO,@Param("type") String type);

    List<ResourceSimpLevelMinVO> fireResourceSimpList(@Param("tableName") String tableName, @Param("rank") Integer rank, @Param("ViewSearchDTO") ViewSearchDTO viewSearchDTO);

    IPage<FireQueryAllListVO> queryAllFireByCondition(IPage<FireQueryAllListVO> appTaskStatusPage, @Param("fireQueryListDTO") FireQueryListDTO fireQueryListDTO);

    List<FireQueryAllListVO> queryAllFireByNopage(@Param("fireQueryListDTO") FireQueryNoPageListDTO fireQueryListDTO);


    IPage<FireQuerySituationAllListVO> queryFireSituationByCondition(IPage<FireQuerySituationAllListVO> appTaskStatusPage, @Param("fireSituationListDTO") FireSituationListDTO fireSituationListDTO);


    FireQueryAllListVO findFireDetailByFireId(@Param("fireId") String fireId);

    List<String> findFireIdByIsWatchman(@Param("isWatchman") Integer isWatchman, @Param("districtCode") String districtCode,@Param("status")Integer status);

    List<FireQueryAllListVO> findAllTrueFire();

    @Select("select is_rescue from comm_fire_alarm where id=#{fireId}")
    Integer findIsRescue(@Param("fireId") String fireId);

    IPage<FireQueryAllListVO> findIsRead(IPage<FireQueryAllListVO> appTaskStatusPage, @Param("fireIsReadDTO") FireIsReadDTO fireIsReadDTO);

    List<Map>findCameraType(@Param("code") String code);


    int countFireAlarm(@Param("districtCode") String districtCode,@Param("status")Integer status,@Param("resource")String resource,
                       @Param("beginOfDay") Date beginOfDay,
                       @Param("endOfDay")Date endOfDay);

}
